<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPageSERIX.Master" AutoEventWireup="true"
    CodeBehind="ProgramaMunicipios.aspx.cs" Inherits="SERIX.ProgramaMunicipios" %>

<%@ Register Src="Controles/Navegador.ascx" TagName="Navegador" TagPrefix="uc1" %>
<%@ Register Src="Controles/lovGenerica.ascx" TagName="lovGenerica" TagPrefix="uc2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table width="97%" border="0" cellspacing="0" cellpadding="2" align="center">
        <tr>
            <td class="secao_titulo" style="width: 284px">
                Vinculo de Municipios a Programas <hr class="linhaHorizontal" style="width: 740px" />
            </td>
        </tr>
    </table>
    <asp:UpdatePanel ID="UpdatePanelFiltro" runat="server">
        <ContentTemplate>
            <table align="center" border="0" cellpadding="2" cellspacing="0" width="97%">
                <tr>
                    <td align="center" class="grid_titulo">
                        <span style="color: #FFFFFF">Programa: 
                        <br />
                        </span>
                        <asp:DropDownList runat="server" ID="ddlProgramas" AutoPostBack="True" 
                            DataSourceID="obsPrograma" DataTextField="NOM_PROG" DataValueField="idt_Prog" 
                            onselectedindexchanged="ddlProgramas_SelectedIndexChanged"></asp:DropDownList>
                        <asp:ObjectDataSource ID="obsPrograma" runat="server" 
                            OldValuesParameterFormatString="original_{0}" SelectMethod="ObterTodos" 
                            TypeName="SERIX.CProgramas"></asp:ObjectDataSource>
                    </td>
                </tr>
                <tr>
                    <td class="grid_titulo">
                        <span style="color: #FFFFFF">Ano:</span>
                        <asp:DropDownList ID="ddlAno" runat="server" AutoPostBack="True" 
                            onselectedindexchanged="ddlAno_SelectedIndexChanged">
                        </asp:DropDownList>
                    </td>
                </tr>
            </table>
            <asp:GridView ID="gridView" runat="server" AutoGenerateColumns="False" CssClass="grid"
                OnRowDataBound="gridView_RowDataBound" EmptyDataText="Nenhum registro encontrado."
                DataKeyNames="idt_mun" DataSourceID="odsProgramas">
                <AlternatingRowStyle CssClass="row_alter" />
                <Columns>
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:CheckBox ID="cbxProgramado" runat="server" />
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:CheckBox ID="CheckBox1" runat="server" />
                        </EditItemTemplate>
                        <HeaderTemplate>
                            <asp:CheckBox ID="cbxMuniciopiosHeader" runat="server" AutoPostBack="True" OnCheckedChanged="cbxMuniciopiosHeader_CheckedChanged" />
                        </HeaderTemplate>
                        <HeaderStyle Width="30px" />
                        <ItemStyle Width="30px" />
                    </asp:TemplateField>
                    <asp:BoundField DataField="nome_mun" HeaderText="Municipio" ItemStyle-Width="320px">
                        <ItemStyle Width="320px"></ItemStyle>
                    </asp:BoundField>
                </Columns>
                <EmptyDataRowStyle CssClass="emptyrow" />
                <FooterStyle CssClass="footer" />
                <HeaderStyle CssClass="header" />
                <PagerStyle CssClass="pager" />
                <RowStyle CssClass="row" />
            </asp:GridView>
            <div style="text-align: right">
                <asp:Button ID="btnConfirmar" runat="server" Font-Bold="True" Text="Confirmar" UseSubmitBehavior="False"
                    Width="78px" OnClick="btnConfirmar_Click" />
                <br />
                <asp:Label ID="lblmsg" runat="server" CssClass="label_verde" TabIndex="-1" Visible="False"
                    Width="740px"></asp:Label>
            </div>
            <asp:ObjectDataSource ID="odsProgramas" runat="server" OnSelecting="odsProgramas_Selecting"
                SelectMethod="ObterTodosPorIDT_PROG" TypeName="SERIX.CProgramasMunicipios" 
                OldValuesParameterFormatString="original_{0}">
                <SelectParameters>
                    <asp:Parameter Name="idt_prog" Type="String" />
                    <asp:ControlParameter ControlID="ddlAno" Name="pms_ANO" 
                        PropertyName="SelectedValue" Type="Int32" />
                </SelectParameters>
            </asp:ObjectDataSource>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
